#include <QDebug>
#include "vfoldercreatedialog.h"
#include "ui_vfoldercreatedialog.h"

VfolderCreateDialog::VfolderCreateDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::VfolderCreateDialog)
{
    ui->setupUi(this);
}


void VfolderCreateDialog::closeEvent(QCloseEvent *)
{
    deleteLater();
}


VfolderCreateDialog::~VfolderCreateDialog()
{
    qWarning() << __FUNCTION__;
    delete ui;
}


QString VfolderCreateDialog::getEnterName()
{
    return ui->lineEdit->text();
}


void VfolderCreateDialog::on_buttonBox_accepted()
{
    emit createFolder(getEnterName());
    close();
}


void VfolderCreateDialog::on_buttonBox_rejected()
{
    close();
}


void VfolderCreateDialog::on_add_pushButton_clicked()
{
    emit createFolder(getEnterName());
}
